<template>
  <div class="detail-logistics">
    <p>
      <span>{{list[0].time}}</span>
      <span>{{list[0].text}}</span>
    </p>
    <a href="javascript:;" @click="handlerLogistics(order)">查看物流</a>
  <Teleport to="#model">
    <OrderLogistics ref="logisticsOrderCom" />
  </Teleport>
  </div>
</template>
<script setup>
import { defineProps, ref } from 'vue'
import { logisticsOrder } from '@/api/order';
import OrderLogistics from './order-logistics'
  const props = defineProps({
    order: {
      type: Object,
      default: () => ({})
    }
  })
  const data = await logisticsOrder(props.order.id)
  const list = ref(data.result.list)
  // 查看收货
  const logisticsOrderCom = ref(null)
  const handlerLogistics = (item) => {
    logisticsOrderCom.value.open(item)
  }
</script>
<style scoped lang="less">
.detail-logistics {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  background-color: #f5f5f5;
  margin: 30px 50px 0;
  > p {
    flex: 1;
    span {
      color: #999;
      &:first-child {
        margin-right: 30px;
      }
    }
  }
  > a {
    color: @mainColor;
    text-align: center;
  }
}
</style>